package com.ycode.bang.anbang.activity;

import android.os.Bundle;
import android.os.PersistableBundle;
import android.view.View;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.TextView;

import com.ycode.bang.anbang.R;
import com.ycode.bang.anbang.baseui.BaseActivity;
import com.ycode.bang.anbang.baseui.BaseFragment;

import java.util.ArrayList;
import java.util.List;

import butterknife.ButterKnife;
import butterknife.InjectView;

/**
 * Created by squirrel on 2016/5/16.
 */
public class GetExpressMainActivity extends BaseActivity implements View.OnClickListener {

    @InjectView(R.id.title)
    TextView title;

    @InjectView(R.id.right_text)
    TextView right;

    @InjectView(R.id.no_get_goods_button)
    Button noGetGoodsButton;
    @InjectView(R.id.get_goods_button)
    Button getGoodsButton;
    @InjectView(R.id.wait_to_get_goods_button)
    Button waitToGetGoodsButton;
    @InjectView(R.id.wait_to_send_goods_button)
    Button waitToSendGoodsButton;
    @InjectView(R.id.have_get_good_button)
    Button haveGetGoodButton;
    @InjectView(R.id.fl_order)
    FrameLayout flOrder;
    Button []usedButton;

    private List<BaseFragment> mFragmentList=new ArrayList<BaseFragment>();

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        addOurView(R.layout.activity_express_list);
        ButterKnife.inject(this);
        initView();
        initData();
    }

    private void initData() {
    }


    private void initView() {
        usedButton=new Button[]{noGetGoodsButton,getGoodsButton};
        title.setText(R.string.get_express);
        right.setText(R.string.scan_code);
        noGetGoodsButton.setSelected(true);
        for (Button bu:usedButton) {
            bu.setOnClickListener(this);
        }
    }

    @Override
    protected void getSuccessRequest(Object response, int flag) {

    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.no_get_goods_button:
                for (Button bu:usedButton) {
                    bu.setSelected(false);
                }
                v.setSelected(true);
                break;
            case R.id.get_goods_button:
                for (Button bu:usedButton) {
                    bu.setSelected(false);
                }
                v.setSelected(true);
                break;

        }
    }
}
